package main;

import processing.core.PApplet;
import processing.core.PImage;

public class CreateImage extends PApplet {

    PImage pImage;

    @Override
    public void settings() {
        size(640, 360);
    }

    @Override
    public void setup() {
        pImage = createImage(230,230,ARGB);

        for(int i = 0; i < pImage.pixels.length; i++) {
           float a = map(i, 0, pImage.pixels.length, 255, 0);
           pImage.pixels[i] = color(0, 153, 204, a);
        }
    }

    @Override
    public void draw() {
        background(255);
        image(pImage, 90, 80);
        image(pImage, mouseX-pImage.width/2f, mouseY-pImage.width/2f);
    }
}
